<?php
class MyLibrary {
	
	// A reference to CodeIgniter super object
	private $CI;
	
	public function __construct() {
		
		// get a reference to the super object so we can use the resources
		$this->CI = & get_instance();
	}
	
	
	/**
	 * get the address with all fields except the site domain and the last field
	 */
	public function getAddressJScalls() {
		$arr = explode('/', current_url());
		unset($arr[count($arr)-1]);
		unset($arr[0]);		// 'http'
		unset($arr[1]);		// ''
		unset($arr[2]);		// 'www.something.com'
		$var = implode('/', $arr);
		$var = '/'.$var;
		//$this->CI->firephp->log($var);
		return $var;
	}
	
}